<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="@{'/public/stylesheets/platform/gatekeeper.css'}" rel="stylesheet" type="text/css" />  
	 <script src="@{'/public/javascripts/jquery-1.6.4.min.js'}" type="text/javascript" charset="{_response_encoding}"></script>  
	<title>Crane Studio</title>
	<script language="JavaScript" charset="{_response_encoding}">
		$(document).ready(function(){	
			
				//$("#msg").hide();	
			$('#refresh').click(function(){				
					var listAction = #{jsAction @captchaIdGenerater() /} 
	        		$('#tmp').load(listAction(), function(data) {  
						  var url = "/gatekeeper/captcha?id="+data; 
						  $('#captchaImg').attr("src",url);		
						  $('#captchaID').val(data);		 
	        		});
					
				});
			});	   
			function showMessage(msg){
					$("#sp_err").html(msg);
					$("#sp_err").show();
				}
			function checkForm(){
				if($("#username").val()==''){
					showMessage("请输入用户名");
					return false;
				}
				if($("#password").val()==''){
					showMessage("请输入密码");
					return false;
				}
				if($("#code").val()==''){
					showMessage("请输入验证码");
					return false;
				}
				return true;
			}  	
			function doSubmit()
			{
				if (checkForm()) {
					document.logform.submit();
				}
			}
			function enterSubmit()
			{
				document.onkeydown = function(e){
			        if(!e) e = window.event;//火狐中是 window.event
			        if((e.keyCode || e.which) == 13){
			           doSubmit();
			        }
		    	}
			} 
	</script>
</head>
<body>
<div class="full">
	<div style="display:none" id="tmp"></div>
	<div class="logo_login02">
		<img src="@{'/public/images/gatekeeper/logo_login01.jpg'}">
	</div>
	<div class="content_login">
	<div class="top_bg"></div>
	<!--登t录框-->
	<div class="left_login">		
		<div class="div">
		<form action="@{GateKeeper.doLogin()}" id="logform" name="logform" method="post" onsubmit="return onSubmit();">
			<table>
				<tbody>
					<tr>
				    	<td></td>
						<td><span style="color: rgb(255, 0, 0);" id="sp_err">
							#{ifErrors}		        			
		            			${errors[0]}
		    				#{/ifErrors}	
						</span></td>
				    </tr>
					<tr>
						<td width="60">用户名：</td>
						<td><input type="text" maxlength="100" onkeypress="enterSubmit()" class="inputbox" name="username" id="username" style="color: rgb(153, 153, 153);"></td>
					</tr>
					<tr>
						<td>密　码：</td>
						<td><input type="password" maxlength="50" onkeypress="enterSubmit()" class="inputbox" id="password" name="password"></td>
					</tr>
					<tr>
						<td></td>
						<td>
							<img id="captchaImg"  src="@{Gatekeeper.captcha(captchaID)}" title="验证码"/>
							<a href="javascript:void(0);" id="refresh">换一个</a><br/>							
							<input type="hidden" id="captchaID" name="captchaID" value="${captchaID}" />		
						</td>
					</tr>
					<tr id="tr_c">
						<td>验证码：</td>
						<td><input type="text" maxlength="10" onkeypress="enterSubmit()" class="inputbox" name="code" id="code"></td>
					</tr>
					<tr style="display: none;" id="tr_vc">
						<td></td>
						<td><img src="images/bit.gif" alt="" id="vcImg"><a class="font_gray" href="javascript:void(0);" id="aRecode">
						看不清，换一张</a>
						</td>
					</tr>
					<tr>
						<td></td>
						<td><input type="checkbox" class="checkbox" style="vertical-align: middle;" name="rememberMe" id="rememberMe">
							<label class="font_red" for="chkRemember">两周内自动登录</label>
						</td>
					</tr>
					<tr>
						<td></td>
						<td>
							<a href="javascript:void(0);" class="btn_login" id="aLogin" onclick="doSubmit()"><span>登 录</span></a>
				            <a target="_top" class="font_gray" href="#">忘记密码</a>
				            
						</td>
					</tr>
				    
				</tbody>
			</table>
		</form>	
		</div>	
	</div>
	<!--登录框结束-->

<div class="center_login"></div>
	<!--右侧广告或者注册-->
	<div class="right_login">
		<p>我们诚挚的邀请您的加入<br/></>CRANE---华中科技大学集群与网格实验室云计算平台<small>CNGI和ChinaGrid项目提供支持 
</small></p>
		<p class="button"><a href="@{GateKeeper.register}" class="btn_loginr"><span>立即注册</span></a></p>
	</div>
	<!--右侧结束-->
	<div class="btm_bg"></div>
</div>
</div>
</body>
</html>
